<%@ page import="pro.syg.JdbcUtils" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%
    String username = request.getParameter("u");
    String password = request.getParameter("p");
    String sql = "SELECT id FROM `user` WHERE username = ? AND `password` = MD5(?)";
    Integer id = JdbcUtils.select(sql, Integer.class, username, password);
    String message = id != null && id > 0 ? "登录成功！" : "登录失败！";

    PrintWriter writer = response.getWriter();
    writer.write(message);
    writer.flush();
    writer.close();
%>



